package com.xuge.controller;

import com.xuge.pojo.UserEntry;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/test")
public class TestController {

    @Test
    public void test(){
        ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("Application.xml");
        UserEntry userEntry = (UserEntry) app.getBean("userEntry");
        System.out.println(userEntry.toString());

    }

    @GetMapping("/test")
    public String test1(){
        return "test";
    }
    @PostMapping("test2")
    public String test2(){
        return "test2";
    }
}
